package other;

import java.util.Scanner;

/*

3**11 = ((3**5)**2)*3
3**5 = ((3**2)**2)*3
3**2 = 3*3



 */
public class QuickPow {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            int base = scan.nextInt();
            int exponent = scan.nextInt();
            System.out.println(quickPow(base, exponent));
        }
    }

    private static int quickPow(int base, int exponent) {
        if (exponent == 0) {
            return 1;
        }
        int result = 1;
        int temp = quickPow(base, exponent/2);
        result *= temp*temp;
        if (exponent % 2 == 1) {
            result *= base;
        }
        return result;
    }

}
